home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.006 / xemacs-1 / lib / xemacs-19.13 / lisp / ilisp / ilisp-def.el < prev    next >
Encoding:
Text File  |  1995-01-26  |  13.3 KB  |  378 lines

  1. ;;; -*- Mode: Emacs-Lisp -*-
  2.  
  3. ;;; ilisp-def.el --
  4.  
  5. ;;; This file is part of ILISP.
  6. ;;; Version: 5.7
  7. ;;;
  8. ;;; Copyright (C) 1990, 1991, 1992, 1993 Chris McConnell
  9. ;;;               1993, 1994 Ivan Vasquez
  10. ;;;               1994, 1995 Marco Antoniotti and Rick Busdiecker
  11. ;;;
  12. ;;; Other authors' names for which this Copyright notice also holds
  13. ;;; may appear later in this file.
  14. ;;;
  15. ;;; Send mail to 'ilisp-request@lehman.com' to be included in the
  16. ;;; ILISP mailing list. 'ilisp@lehman.com' is the general ILISP
  17. ;;; mailing list were bugs and improvements are discussed.
  18. ;;;
  19. ;;; ILISP is freely redistributable under the terms found in the file
  20. ;;; COPYING.
  21.  
  22.  
  23.  
  24. ;;;
  25. ;;; ILISP defvar's
  26. ;;;
  27.  
  28. ;;;%Variables
  29. ;;;%%Deflocal
  30. (defvar ilisp-locals '(comint-prompt-regexp 
  31.                input-ring-size
  32.                comint-get-old-input
  33.                comint-input-sentinel
  34.                comint-input-filter
  35.                comint-input-sender
  36.                comint-eol-on-send
  37.                comint-send-newline
  38.                comint-always-scroll
  39.                comint-fix-error
  40.                comint-continue
  41.                comint-interrupt-regexp
  42.                comint-error-regexp
  43.                comint-output-filter
  44.                comint-interrupt-start
  45.                comint-handler
  46.                comint-update-status
  47.                comint-prompt-status
  48.                comint-abort-hook)
  49.   "List of ilisp local variables.")
  50. (defun lisp-deflocal (local)
  51.   (if (not (memq local ilisp-locals))
  52.       (setq ilisp-locals (cons local ilisp-locals))))
  53.  
  54.  
  55. ;;;
  56. (defmacro deflocal (variable default &optional documentation)
  57.   "Define an ilisp local variable."
  58.   (` (progn (lisp-deflocal '(, variable))
  59.         (defvar (, variable) (, default) (, documentation)))))
  60.  
  61. ;;;%%Simple customization
  62. (defvar ilisp-prefix "\C-z" "Prefix sequence for ilisp commands.")
  63.  
  64. (deflocal ilisp-program nil
  65.   "*Program and arguments for invoking an inferior LISP.  The program
  66. can be an rsh to run on a remote machine.  If there is not a common
  67. file system, the interface files will be sent down the pipe instead.
  68. The value of this variable is set from DIALECT-program, or inherited
  69. from a less specific dialect if DIALECT-program is nil.")
  70.  
  71. (defvar ilisp-motd 
  72.   "ILISP V%s  Use M-x ilisp-bug for problems and suggestions."
  73.   "*Message of the day format string for ILISP given VERSION. To
  74. prevent any message from being printed, set this to nil.")
  75.  
  76. (defvar lisp-wait-p nil
  77.   "*T if LISP eval/compile commands should wait for the result.  A
  78. minus prefix to the command will change the sense of this switch for
  79. just the next command.")
  80.  
  81. (defvar lisp-no-popper 'message
  82.   "*T if you want all output in the inferior LISP rather than in a
  83. pop-up window.  'message if you want output of one line to go to the
  84. message window (or to the inferior LISP if more).  You should probably
  85. also set comint-always-scroll to T as well so that output is always visible.")
  86.  
  87. (defvar lisp-show-status t 
  88.   "*Set to nil to stop showing process status in lisp-mode buffers.")
  89.  
  90. (defvar ilisp-prefix-match nil
  91.   "*Set to T to match only as a prefix when completing through the
  92. inferior LISP.  This will speed up completion, but you no longer get
  93. partial completion.") 
  94.  
  95. (deflocal ilisp-filter-regexp nil
  96.   "*What not to save on an inferior LISP's input history.
  97. Input matching this regexp is not saved on the input history in ilisp
  98. mode.")
  99.  
  100. (deflocal ilisp-filter-length 3
  101.   "*Do not save strings less than this in the command history.")
  102.  
  103. (deflocal ilisp-other-prompt nil
  104.   "*Regexp to recognise prompts in the inferior LISP that are prompts
  105. of non-(read/eval/print) top-levels so that bol-ilisp skips them.")
  106.  
  107. (deflocal ilisp-raw-echo nil
  108.   "*Set this to T to cause echoing in raw keyboard mode.")
  109.  
  110. (deflocal ilisp-load-no-compile-query nil
  111.   "*Set this to T to stop load querying about compile.")
  112.  
  113. ;;;%%%Hooks
  114. (defvar ilisp-site-hook nil
  115.   "Hook for site customization of ilisp mode when it is loaded.")
  116.  
  117. (defvar ilisp-load-hook '()
  118.   "Hook for customizing ilisp mode when it is loaded.")
  119.  
  120. (defvar ilisp-mode-hook '()
  121.   "Hook for customizing ilisp mode.")
  122.  
  123. (deflocal ilisp-init-hook nil
  124.   "Hook of functions to call on first prompt in inferior LISP.")
  125.  
  126. ;;;%%Advanced customization
  127. ;;;%%%Commands
  128. (deflocal ilisp-reset nil
  129.   "String for resetting the top-level of the inferior LISP.")
  130.  
  131. (deflocal ilisp-load-or-send-command nil
  132.   "Format string for loading BINARY if possible otherwise loading
  133. FILE.  If you can't load either, return NIL.")
  134.  
  135. (deflocal ilisp-package-regexp nil
  136.   "Regular expression for finding a package specification in a buffer.
  137. The entire sexp starting with this pattern will be passed to
  138. ilisp-package-command to find the package.")
  139.  
  140. (deflocal ilisp-package-command nil
  141.   "Format string to find the package given PACKAGE.")
  142.  
  143. (deflocal ilisp-package-name-command nil
  144.   "Format string to return the name of the current package.")
  145.  
  146. (deflocal ilisp-in-package-command nil
  147.   "Format string to set the package given PACKAGE.")
  148.  
  149. (deflocal ilisp-last-command nil
  150.   "Format string for getting the last returned value.")
  151.  
  152. (deflocal ilisp-save-command nil
  153.   "Format string for saving result history given FORM.")
  154.  
  155. (deflocal ilisp-restore-command nil
  156.   "Format string for restoring result history.")
  157.  
  158. (deflocal ilisp-block-command nil
  159.   "Format string for grouping FORMS into one.")
  160.  
  161. (deflocal ilisp-eval-command nil
  162.   "Format string for evaluating FORM in PACKAGE from FILE.")
  163.  
  164. (deflocal ilisp-defvar-regexp nil
  165.   "Regular expression for identifying a defvar form.")
  166.  
  167. (deflocal ilisp-defvar-command nil
  168.   "Format string for re-evaluating DEFVAR in PACKAGE from FILE.")
  169.  
  170. (deflocal ilisp-describe-command nil
  171.   "Format string for describing FORM in PACKAGE.")
  172.  
  173. (deflocal ilisp-compile-command nil
  174.   "Format string for compiling FORM in PACKAGE.")
  175.  
  176. (deflocal ilisp-inspect-command nil
  177.   "Format string for inspecting FORM in PACKAGE.")
  178.  
  179. (deflocal ilisp-arglist-command nil
  180.   "Format string for arglist of SYMBOL in PACKAGE.")
  181.  
  182. (deflocal ilisp-documentation-types nil
  183.   "((\"type\") ...) possible LISP documentation types.")
  184.  
  185. (deflocal ilisp-documentation-command nil
  186.   "Format string for documentation given SYMBOL in PACKAGE and TYPE.")
  187.  
  188. (deflocal ilisp-macroexpand-1-command nil
  189.   "Format string for top-level macroexpand given FORM and PACKAGE.")
  190.  
  191. (deflocal ilisp-macroexpand-command  nil
  192.   "Format string for macroexpand given FORM and PACKAGE.")
  193.  
  194. (deflocal ilisp-complete-command nil
  195.   "Format string for finding possibly matching symbols given SYMBOL,
  196. PACKAGE, FUNCTIONP, EXTERNALP and PARTIAL-MATCHP.  It should print
  197. ((string) (string) ...).")
  198.  
  199. (deflocal ilisp-callers-command nil
  200.   "Format for finding the callers of SYMBOL in PACKAGE.  The function
  201. should print out callers with one per line.")
  202.  
  203. (deflocal ilisp-trace-command nil
  204.   "Format for tracing SYMBOL in PACKAGE.")
  205. (deflocal ilisp-untrace-command nil
  206.   "Format for untracing SYMBOL in PACKAGE.")
  207.  
  208. (deflocal ilisp-directory-command nil
  209.   "Format for getting default DIRECTORY.")
  210. (deflocal ilisp-set-directory-command nil
  211.   "Format for setting default DIRECTORY.")
  212.  
  213. (deflocal ilisp-binary-command nil
  214.   "Command to return the extension for binary files.")
  215.  
  216. (deflocal ilisp-binary-extension nil
  217.   "*The extension to use for LISP binaries.  If there is an
  218. ilisp-binary-command, this string will be determined at initilization time.")
  219.  
  220. (deflocal ilisp-init-binary-command nil
  221.   "Command to return the extension for initialization binary files.")
  222.  
  223. (deflocal ilisp-init-binary-extension nil
  224.   "The extension for initialization binary files.  If there is an
  225. ilisp-init-binary-command, this string will be determined at
  226. initilization time.")
  227.  
  228. (deflocal ilisp-load-command nil
  229.   "Format string for loading a file in LISP given FILE.")
  230.  
  231. (deflocal ilisp-compile-file-command nil
  232.   "Format string for compiling a file in LISP given FILE and EXTENSION.")
  233.  
  234. ;;;%%%%Source
  235. (deflocal ilisp-source-types nil
  236.   "Alist of strings for source types.  The strings can be either
  237. symbols or list expressions since the input accepts symbols or open
  238. ended lists as type specifiers.")
  239.  
  240. (deflocal ilisp-find-source-command nil
  241.   "Format string for finding the source file that defined SYMBOL in
  242. PACKAGE.  It should return NIL if no source is found.")
  243.  
  244. (deflocal ilisp-locator nil
  245.   "Function \(SYMBOL TYPE FIRST-P BACK-P) that finds the next SYMBOL TYPE
  246. definition in the current buffer.  FIRST-P is T the first time it is
  247. called in a buffer.  BACK-P is T to move backwards.")
  248.  
  249. (deflocal ilisp-calls-locator nil
  250.   "Function \(SYMBOL TYPE FIRST-P BACK-P ) that finds calls to SYMBOL
  251. in the current buffer.  FIRST-P is T the first time it is called in a
  252. buffer.  BACK-P is T to move backwards.")
  253.  
  254. (deflocal ilisp-source-directory-fixup-alist
  255.     nil
  256.   "*An alist of (REGEXP . FIXUP-FUNCTION) which will be applied to
  257. lists of source filenames to be used with edit-definitions-list.
  258. FIXUP-FUNCTION takes no arguments and should use replace-match to fix
  259. the filenames.")
  260.  
  261.  
  262. ;;;%%%Misc
  263. (deflocal ilisp-use-map nil "Keymap to use in ILISP mode.")
  264.  
  265. (defvar ilisp-bugs-to "ilisp@lehman.com" "Who to send bug reports to.")
  266.  
  267. (defvar ilisp-modes '(ilisp-mode) "List of all inferior ilisp modes.")
  268. (defvar lisp-source-modes '(lisp-mode scheme-mode)
  269.   "Used to determine if a buffer contains Lisp source code.
  270. If it's loaded into a buffer that is in one of these major modes, it's
  271. considered a lisp source file by find-file-lisp, load-file-lisp and
  272. compile-file-lisp. Used by these commands to determine defaults.")
  273.  
  274. (deflocal ilisp-no-newline nil
  275.   "Set to T to stop ilisp from inserting a newline after a command.")
  276.  
  277. (deflocal ilisp-error-filter nil "Function to filter error output.")
  278. (deflocal ilisp-error-regexp nil "Regular expression to match error.")
  279.  
  280. (deflocal ilisp-symbol-delimiters nil
  281.   "Delimiters found around symbols.")
  282.  
  283. ;;;%%Program
  284. (defvar ilisp-completion-map nil "Keymap for reading ilisp readers.")
  285. (defvar ilisp-epoch-running (and (boundp 'epoch::version) epoch::version)
  286.   "Non-nil if epoch is running.")
  287. (defvar ilisp-version 
  288.   "5.7" ;; ILISP-VERSION marker
  289.   "Interface version.")
  290. (defvar ilisp-directory nil "The directory that ilisp is found in.")
  291. (defvar ilisp-mode-map nil "Key map for ILISP.")
  292. (defvar ilisp-raw-map  nil
  293.   "Keyboard map for sending characters directly to the inferior LISP.")
  294. (defvar ilisp-raw-message "Raw keyboard mode until C-g"
  295.   "Message for how to stop raw mode.")
  296. (defvar ilisp-buffer nil "Name of selected ilisp buffer.")
  297. (defvar ilisp-status nil "Status string for selected ilisp buffer.")
  298. (defvar ilisp-buffers nil "List of ILISP buffers.")
  299. (defvar ilisp-dialects nil "List of ILISP dialects.")
  300.  
  301. (deflocal ilisp-load-inits nil
  302.   "Alist of dialect files to load when initializing an inferior LISP.
  303. By default the file will be loaded from the ilisp-directory.")
  304.  
  305. ;;; This is useful to have a clause in ilisp code like:
  306. ;;; (if (memq 'allegro (ilisp-value 'ilisp-dialect)) 
  307. ;;;     allegro-code
  308. ;;;     normal-code)
  309. (deflocal ilisp-dialect nil
  310.   "List of the dialects that defined the current inferior LISP.")
  311.  
  312. (defvar ilisp-initialized nil
  313.   "List of buffer names that have been initialized.")
  314. (deflocal ilisp-initializing nil
  315.   "Set to T while waiting for inferior LISP to get initialized.")
  316.  
  317. (deflocal ilisp-load-files nil "List of files being loaded.")
  318.  
  319. (defvar lisp-changes nil
  320.   "List of markers for changed forms.")
  321. (deflocal ilisp-pending-changes nil
  322.   "List of changes that are pending, but have not been confirmed yet.")
  323.  
  324. ;;;%%%Completion
  325. ;;; Dynamically bound variables for controlling reading
  326. (defvar ilisp-complete nil "T if in minibuffer completion mode.")
  327. (defvar ilisp-no-complete nil "T if incomplete symbols are allowed.")
  328. (defvar ilisp-table nil "Completion table for ilisp readers.")
  329. (defvar ilisp-paren nil "T if paren is allowed in ilisp readers.")
  330. (defvar ilisp-completion-package nil 
  331.   "Package of buffer requesting completion.")
  332. (defvar ilisp-completion-function-p nil
  333.   "T if only symbols with function values are allowed.")
  334.  
  335. ;;; State variables for ilisp reading
  336. (defvar ilisp-mini-prefix nil "Package and qualification from minibuffer.")
  337. (defvar ilisp-original nil "Original string for ilisp completion.")
  338. (defvar ilisp-original-function-p nil "Function-p for ilisp completion.")
  339. (defvar ilisp-original-table nil "Completion table for ilisp-original.")
  340.  
  341. ;;;%Buffer
  342. ;;;%Packages
  343. (defvar buffer-package 'not-yet-computed "Cached package name.")
  344. (defvar buffer-mode-name nil "Original mode name.")
  345. (defvar lisp-buffer-package nil "T if in lisp-buffer-package.")
  346. (defvar lisp-dont-cache-package nil 
  347.   "If Non-Nil then refind the most recent in-package each time.")
  348.  
  349. ;;;%Globals from ilisp-ext.el
  350. ;;;
  351. (defvar ilisp-ext-load-hook nil "Hook to run when extensions are loaded.")
  352. (defvar left-delimiter "\(" "*Left delimiter for find-unbalanced.")
  353. (defvar right-delimiter "\)" "*Right delimiter for find-unbalanced.")
  354.  
  355. ;;; Copies of ilisp var definitions
  356. (defvar ilisp-complete nil "T when ilisp is in completion mode.")
  357. (defvar ilisp-modes '(ilisp-mode) "List of all inferior ilisp modes.")
  358. (defvar lisp-fill-marker (make-marker)
  359.   "Keeps track of point so that it does not move during a reindent-lisp.")
  360. (defvar ilisp-comment-marker (make-marker)
  361.   "Marker for end of a comment region.")
  362.  
  363.  
  364. (defvar lisp-buffer-file nil 
  365.   "Cons of buffer-file-name and the expanded name.")
  366. (make-variable-buffer-local 'lisp-buffer-file)
  367.  
  368. (defvar ilisp-last-message nil)
  369. (defvar ilisp-last-prompt nil)
  370.  
  371. (defvar lisp-prev-l/c-dir/file nil
  372.   "Saves the (directory . file) pair used in the last find-file-lisp,
  373. load-file-lisp or compile-file-lisp command. Used for determining the
  374. default in the next one.")
  375.  
  376. (defvar ilisp-last-buffer nil
  377.   "The last used LISP buffer.")
  378.